package solution

func V1(s string) int {
	sLen := len(s)

	rLen := 0

	if sLen == 0 {
		return rLen
	}

	for i := sLen - 1; i >= 0; i-- {
		if string(s[i]) == " " {
			if rLen > 0 {
				return rLen
			}
		} else {
			rLen++
		}
	}

	return rLen
}
